<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.io.stream.DigestStream</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.io.stream.DigestStream";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.io.stream.DigestStream.html" class="symbol">tango.io.stream.DigestStream</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Initial release: Oct 2007
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">class <a class="symbol _class" name="DigestInput" href="./htmlsrc/tango.io.stream.DigestStream.html#L26" kind="class" beg="26" end="71">DigestInput</a> : InputFilter; <a title="Permalink to this symbol" href="#DigestInput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L26">#</a></dt>
<dd class="ddef">
<div class="summary">Inject a digest filter into an input stream, updating the digest
        as information flows through it</div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="DigestInput.this" href="./htmlsrc/tango.io.stream.DigestStream.html#L36" kind="ctor" beg="36" end="40">this</a><span class="params">(InputStream <em>stream</em>, Digest <em>digest</em>)</span>; <a title="Permalink to this symbol" href="#DigestInput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L36">#</a></dt>
<dd class="ddef">
<div class="summary">Accepts any input stream, and any digest derivation</div></dd>
<dt class="decl">uint <a class="symbol _function" name="DigestInput.read" href="./htmlsrc/tango.io.stream.DigestStream.html#L52" kind="function" beg="52" end="58">read</a><span class="params">(void[] <em>dst</em>)</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DigestInput.read" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L52">#</a></dt>
<dd class="ddef">
<div class="summary">Read from conduit into a target array. The provided dst 
                will be populated with content from the conduit.</div>
Returns the number of bytes read, which may be less than
                requested in dst (or IOStream.Eof for end-of-flow)</dd>
<dt class="decl">Digest <a class="symbol _function" name="DigestInput.digest" href="./htmlsrc/tango.io.stream.DigestStream.html#L67" kind="function" beg="67" end="70">digest</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DigestInput.digest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L67">#</a></dt>
<dd class="ddef">
<div class="summary">Return the Digest instance we were created with. Use this
                to access the resultant binary or hex digest value</div></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="DigestOutput" href="./htmlsrc/tango.io.stream.DigestStream.html#L88" kind="class" beg="88" end="133">DigestOutput</a> : OutputFilter; <a title="Permalink to this symbol" href="#DigestOutput" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L88">#</a></dt>
<dd class="ddef">
<div class="summary">Inject a digest filter into an output stream, updating the digest
        as information flows through it. Here's an example where we calculate
        an MD5 digest as a side-effect of copying a file:
        <pre class="d_code">
<span class="k">auto</span> <span class="i">output</span> = <span class="k">new</span> <span class="i">DigestOutput</span>(<span class="k">new</span> <span class="i">FileOutput</span>(<span class="sl">"output"</span>), <span class="k">new</span> <span class="i">Md5</span>);
<span class="i">output</span>.<span class="i">copy</span> (<span class="k">new</span> <span class="i">FileInput</span>(<span class="sl">"input"</span>));

<span class="i">Stdout</span>.<span class="i">formatln</span> (<span class="sl">"hex digest: {}"</span>, <span class="i">output</span>.<span class="i">digest</span>.<span class="i">hexDigest</span>);
</pre></div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="DigestOutput.this" href="./htmlsrc/tango.io.stream.DigestStream.html#L98" kind="ctor" beg="98" end="102">this</a><span class="params">(OutputStream <em>stream</em>, Digest <em>digest</em>)</span>; <a title="Permalink to this symbol" href="#DigestOutput.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L98">#</a></dt>
<dd class="ddef">
<div class="summary">Accepts any output stream, and any digest derivation</div></dd>
<dt class="decl">uint <a class="symbol _function" name="DigestOutput.write" href="./htmlsrc/tango.io.stream.DigestStream.html#L114" kind="function" beg="114" end="120">write</a><span class="params">(void[] <em>src</em>)</span>; <span class="attrs">[<span class="stc">override</span>, <span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DigestOutput.write" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L114">#</a></dt>
<dd class="ddef">
<div class="summary">Write to conduit from a source array. The provided src
                content will be written to the conduit.</div>
Returns the number of bytes written from src, which may
                be less than the quantity provided</dd>
<dt class="decl">Digest <a class="symbol _function" name="DigestOutput.digest" href="./htmlsrc/tango.io.stream.DigestStream.html#L129" kind="function" beg="129" end="132">digest</a><span class="params">()</span>; <span class="attrs">[<span class="stc">final</span>]</span> <a title="Permalink to this symbol" href="#DigestOutput.digest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.stream.DigestStream.html#L129">#</a></dt>
<dd class="ddef">
<div class="summary">Return the Digest instance we were created with. Use this
                to access the resultant binary or hex digest value</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2007 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:01 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>